<?
include('adminPage.php');
include('db_connect.php');

$query = "select assetID, assetName, userID, assetStatus, assetStartDate, assetEndDate,
				assetType, assetRigging, assetTexture, assetDesc from asset";
$result = mysql_query($query);

echo "<table border=1>";
echo "<caption>ASSET LIST</caption>";
echo "<td>No</td><td>Name</td><td>Author</td><td>Status</td><td>StartDate</td><td>EndDate</td>
			<td>Type</td><td>Rigging</td><td>Texture</td><td>Description</td>";
while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
	$num = $row['userID'];
	$search = "select userName from user where userID = $num";
	$user = mysql_query($search);	
	echo "<tr>";
	echo "<td>".$row['assetID']."</td>";
	echo "<td>".$row['assetName']."</td>";
	echo "<td>".mysql_result($user, 0)."</td>";
	echo "<td>".$row['assetStatus']."</td>"; 
	echo "<td>".$row['assetStartDate']."</td>";
	echo "<td>".$row['assetEndDate']."</td>"; 
	echo "<td>".$row['assetType']."</td>";
	echo "<td>".$row['assetRigging']."</td>"; 
	echo "<td>".$row['assetTexture']."</td>";
	echo "<td>".$row['assetDesc']."</td>"; 
	echo "</tr>";
}
echo "</table>";

mysql_close($conn);
?>